package intelligentcity.model.streets;

import intelligentcity.model.Road;

public abstract class Street extends Road {

    protected OneWayStreet firstStreet;
    protected OneWayStreet secondStreet;

    public Street(OneWayStreet firstStreet, OneWayStreet secondStreet) {
        super();
        this.firstStreet = firstStreet;
        this.secondStreet = secondStreet;

    }

    public OneWayStreet getFirstStreet() {
        return firstStreet;
    }

    public OneWayStreet getSecondStreet() {
        return secondStreet;
    }

    @Override
    public String toString() {
        return firstStreet.toString() + "---" + secondStreet.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof Street && ((Street) o).getFirstStreet().equals(firstStreet)
                && ((Street) o).getSecondStreet().equals(secondStreet)) {
            return true;
        }
        return false;
    }

}
